namespace Terra.Core.Common.ErrorCodes.Constants;

using Terra.Core.Common.ErrorCodes.Attributes;
using Terra.Core.Common.ErrorCodes.Models;

/// <summary>
/// 验证错误码
/// </summary>
public static class ValidationErrorCodes
{
    /// <summary>
    /// 必填字段为空
    /// </summary>
    [ErrorCode("VAL001", "字段 {0} 不能为空", Severity = ErrorSeverity.Error)]
    public const string RequiredFieldEmpty = "VAL001";

    /// <summary>
    /// 字段长度无效
    /// </summary>
    [ErrorCode("VAL002", "字段 {0} 的长度必须在 {1} 到 {2} 之间", Severity = ErrorSeverity.Error)]
    public const string InvalidLength = "VAL002";

    /// <summary>
    /// 无效的数字范围
    /// </summary>
    [ErrorCode("VAL003", "字段 {0} 的值必须在 {1} 到 {2} 之间", Severity = ErrorSeverity.Error)]
    public const string InvalidRange = "VAL003";

    /// <summary>
    /// 无效的日期格式
    /// </summary>
    [ErrorCode("VAL004", "字段 {0} 的日期格式无效", Severity = ErrorSeverity.Error)]
    public const string InvalidDateFormat = "VAL004";

    /// <summary>
    /// 无效的邮箱格式
    /// </summary>
    [ErrorCode("VAL005", "无效的邮箱地址: {0}", Severity = ErrorSeverity.Error)]
    public const string InvalidEmail = "VAL005";

    /// <summary>
    /// 无效的手机号格式
    /// </summary>
    [ErrorCode("VAL006", "无效的手机号: {0}", Severity = ErrorSeverity.Error)]
    public const string InvalidPhone = "VAL006";

    /// <summary>
    /// 无效的URL格式
    /// </summary>
    [ErrorCode("VAL007", "无效的URL地址: {0}", Severity = ErrorSeverity.Error)]
    public const string InvalidUrl = "VAL007";

    /// <summary>
    /// 字段值重复
    /// </summary>
    [ErrorCode("VAL008", "字段 {0} 的值 {1} 已存在", Severity = ErrorSeverity.Error)]
    public const string DuplicateValue = "VAL008";

    /// <summary>
    /// 无效的枚举值
    /// </summary>
    [ErrorCode("VAL009", "字段 {0} 的值 {1} 不是有效的选项", Severity = ErrorSeverity.Error)]
    public const string InvalidEnum = "VAL009";

    /// <summary>
    /// 密码复杂度不足
    /// </summary>
    [ErrorCode("VAL010", "密码必须包含大小写字母、数字和特殊字符，长度至少为8位", Severity = ErrorSeverity.Error)]
    public const string WeakPassword = "VAL010";

    /// <summary>
    /// 集合不能为空
    /// </summary>
    [ErrorCode("VAL011", "集合不能为空", Severity = ErrorSeverity.Error)]
    public const string CollectionCannotBeEmpty = "VAL011";

}